package oop4.animal;

public class Doctor {
    public static void main(String[] args) {
        Dog dog = new Dog("大黄", "土狗", 20, 5, '公', 90, 60);
        Cat cat = new Cat("花花", "金渐层", 10, 3, '母', 93, 30);
        Parrot parrot = new Parrot("小青", "玫瑰鹦鹉", 5, 5, '公', 70, 40);
        Tiger tiger = new Tiger("淘淘", "华南虎", 300, 6, '母', 80, 65);
        Squirrel squirrel = new Squirrel("奇奇", "黄山松鼠", 12, 3, '母', 70, 20);
        Doctor doctor = new Doctor();
        doctor.cure(dog);
        doctor.cure(cat);
        doctor.cure(parrot);
        doctor.cure(tiger);
        doctor.cure(squirrel);
    }

    public void cure(Pet pet) {  //给宠物看病，看病流程相同
        if (pet.getHealth() < 60) {
            if (pet instanceof Tiger)
                System.out.println("看病的宠物是一只老虎，需要被捂住嘴");
            System.out.print(pet + "生病了，需要治疗，");
            pet.setHealth(60);
            System.out.println("经过治疗后");
        } else
            System.out.println(pet + "没病");
        System.out.println(pet + "健康值为:" + pet.getHealth() + "\n");
    }
}
